home *** CD-ROM | disk | FTP | other *** search
- unit FlicDef;
-
- interface
-
- uses WinTypes, WinProcs, SysUtils, Controls;
-
- {
- AAOpen and AAClose are not really needed, except there is
- a bug in Windows which prevents Libraries from being
- freed in the Windows Exit Proc (WEP). So we use AAClose
- to free the Libraries when the last task closes the
- AAPlay DLL.
- }
-
- function aaOpen: Integer;
- procedure aaClose;
-
- {
- aaLoad loads an animation:
- WinHandle = parent window of created animation
- X, Y, Width, Height = size of animation window
- Mode = the loading mode
- }
-
- function aaLoad(FileName: PChar; WinHandle: HWnd; Mode: Word;
- X, Y, Width, Height, OrgX, OrgY: Integer): Integer; { HAnim ? }
-
- {
- aaReLoad will load a new animation file into an old animation
- handle. Notifications are lost, but the palette and window are
- retained.
- }
-
- function aaReLoad(HAnim: HWnd; FileName: PChar; Mode, Mask: Word): Integer; { HAnim ? }
-
-
- {
- Valid flags in wMode. The low order eight bits of wMode
- is used in aa_flags.
- }
-
- const
- AA_None = $00;
- AA_MEMORYLOAD = $01; { Load into memory }
- AA_HIDEWINDOW = $02; { Hide the animation window }
- AA_NOPALETTE = $04; { Prevent palette animation }
- AA_RESERVEPALETTE = $08; { Reserve entire palette at start }
- AA_LOOPFRAME = $10; { Loaded with a loop frame }
- AA_FULLSCREEN = $20; { Use full screen for playing }
- AA_STOPNOTIFY = $40; { Prevent any notification messages }
- AA_STOPSTATUS = $80; { Prevent status messages }
- AA_NOFAIL = $100; { Reduce load type on fail }
- AA_DONTPAINT = $200; { Don't paByVal animation when loading }
- AA_BUILDSCRIPT = $400; { FileName is script not name }
- AA_ALLMODES = $FF;
-
-
- {
- aaUnload unloads a loaded animation. FALSE is returned if
- hAa is not the handle of a loaded animation.
- }
-
- function aaUnload(HAnim: HWnd): LongBool;
-
- {
- aaSound will open or close a sound for the animation
- * The sound is opened if FileName is not nil and not ''.
- * The sound is closed if FileName is nil or ''.
- * If device is null, the appropriate device is AutoDetected by file format.
- }
-
- function aaSound(HAnim: HWnd; Device, FileName: PChar; Mode: Word): Integer;
-
-
- {
- Valid flags for the sound mode.
- }
-
- const
- AA_SNDFREEZE = $01; { Freeze frames until sound begins }
- AA_SNDDEVICEID = $100; { device is an ID not a name }
- AA_SNDBUILDALIAS = $200; { create sound device alias }
-
-
- {
- aaPlay plays a loaded animation. TRUE is returned if the
- animation is not stopped when aaPlay returns.
- }
-
- function aaPlay(HAnim: HWnd): LongBool;
-
- {
- aaNotify allows an application to be notified at specific frames
- when an animation is playing. lPosition is the position at which
- the notification is to take place. The wParam for this message is
- hAa, and the lParam is copied from this call. Returns TRUE if the
- notification is set.
- }
-
- function aaNotify(HAnim: HWnd; Position: LongInt; lParam: LongInt): LongBool;
-
-
- {
- This value for the loops will cause the animation to end when
- the sound has finished. If no sound is playing, the animation
- will loop forever.
- }
-
- const
- AA_LOOPSOUND = $FFFF;
-
-
- {
- An automatic notify is sent when an animation in a script is
- reloaded. The lParam of this message is defined below
- }
-
- AA_ANIMATIONLOADED = $0;
-
-
- {
- aaCancel allows an applicatin to cancel notifications set by aaNotify.
- LoPos and HiPos give lower and upper limits on positions. Returns
- the number of notifications canceled.
- }
-
- function aaCancel(HAnim: HWnd; LoPos, HiPos: LongInt): Integer;
-
-
- {
- aaStop will stop a playing animation. TRUE is returned if the
- animation is stopped when aaStop returns.
- }
-
- function aaStop(HAnim: HWnd): LongBool;
-
- {
- aaPause will pause an animation. TRUE is returned if the animation
- is paused when aaPause returns. To resume a paused animation, use
- aaPlay.
- }
-
- function aaPause(HAnim: HWnd): LongBool;
-
- {
- aaPrompt will produce a dialog to prompt for user input. When
-
- input is accepted, the handle is changed to reflect the new
- parameters. The old handle is not destroyed until the new handle
- has been created. aaPrompt returns NULL if the new handle cannot
- be created, otherwise the new handle is returned.
- }
-
- function aaPrompt(HAnim: HWnd; Name: PChar): HWnd;
-
-
- {
- The parameter structure to be used for the animation.
- }
-
- type
- TAAParms = record
- AA_STATUS, { Current status of animation }
- AA_FILETYPE, { Type of file on disk }
- AA_MODE, { Some flags }
- aa_bitpix: String; { bits per pixel }
- AA_WINDOW: HWnd; { Handle of window for status messages }
-
- AA_X, { Left of display window }
- AA_Y, { Top of display window }
- AA_CX, { Width of display window }
- AA_CY, { Height of display window }
- AA_ORGX, { PoByVal in the animation displayed }
- AA_ORGY, { in the upper left corner }
- AA_SPEED, { Speed of animation%e msec per frame }
-
- AA_DESIGNSPEED, { Designed milliseconds per frame }
- AA_WIDTH, { Width of animation in pixels }
-
- AA_HEIGHT, { Height of animation in pixels }
- AA_FRAMES, { Number of frames in animation }
-
- AA_POSITION, { Current frame position }
-
- AA_LOOPS, { End of animation position }
- AA_RPTSOUND, { Number of times to repeat sound }
- AA_PAUSE, { Number of milliseconds to hold last frame }
- AA_DELAYSND: Integer; { Delay Sound in milliseconds }
- AA_TRANSIN, { Transition at start of animation }
- AA_TRANSOUT: String; { Transition at end of animation }
- AA_TIMEIN, { Length of transition in, milliseconds }
- AA_TIMEOUT, { Length of transition out, milliseconds }
- AA_CALLBACK: Integer; { message callback window }
- AA_ANIMWND: HWnd; { Animation Window Handle }
- end;
-
-
- {
- aaGetParm will return information on an animation. Some of the
- information can be set with aaSetParm, and other information is
- state information maintined by AAPLAY.
- }
-
- function aaGetParm(HAnim: HWnd; ParmType: Word): LongInt;
-
- {
- aaGetParmIndirect returns the same information as aaGetParm, in a
- structure for easy access.
- }
-
- function aaGetParmIndirect(HAnim: HWnd; var AParams: TAAParms; Size: Integer): LongInt;
-
-
- {
- aaSetParm will set information on an animation
- }
-
- function aaSetParm(HAnim: HWnd; ParmType: Word; HValue: Integer; LValue: LongInt): LongInt;
-
- {
- aaSetParmIndirect will set animation parameters from a structure
- }
-
- function aaSetParmIndirect(HAnim: HWnd; ParmType: LongInt; AParams: TAAParms; Mask: Word): LongInt;
-
-
- {
- The parameter types that can be used with aaGetParm, and aaSetParm.
- }
-
- const
- AA_STATUS = 1; { Get current status }
- AA_FILETYPE = 2; { Get Type of animation on disk }
- AA_MODE = 3; { Get/Set Animation Flags }
- AA_WINDOW = 4; { Set/Get animation window }
- AA_SPEED = 5; { Set/Get current speed }
- AA_DESIGNSPEED = 6; { Get design speed }
- AA_FRAMES = 7; { Get Number of frames }
- AA_POSITION = 8; { Set/Get current frame position }
- AA_LOOPS = 9; { Set/Get number of loops }
- AA_X = 10; { Set/Get Pos of display window }
- AA_Y = 11; { Set/Get Pos of display window }
- AA_CX = 12; { Set/Get extents of display window }
- AA_CY = 13; { Set/Get extents of display window }
- AA_ORGX = 14; { Set/Get Origin of display window }
- AA_ORGY = 15; { Set/Get Origin of display window }
- AA_WIDTH = 16; { Get Width of animation }
- AA_HEIGHT = 17; { Get Height of animation }
- AA_RPTSOUND = 18; { Set/Get sound repeats }
- AA_PAUSE = 19; { Set/Get pause time }
- AA_DELAYSND = 20; { Set/Get sound delay time }
- AA_TRANSIN = 21; { Set/Get Transition In type }
- AA_TRANSOUT = 22; { Set/Get Transition Out type }
- AA_TIMEIN = 23; { Set/Get Transition In time }
- AA_TIMEOUT = 24; { Set/Get Transition Out Time }
- AA_CALLBACK = 25; { Set/Get CallBack window }
- AA_ANIMWND = 26; { Get Animation Window Handle }
- AA_MODFLAG = 100; { Set/Get Script is modified flag }
- AA_SCRIPTNAME = 101; { Set/Get Script name }
- AA_ANIMATION = 102; { Get/Set Script Animation }
- AA_ANIMATIONCOUNT = 103; { Get Script Animation Count }
- AA_SCRIPTCONTENTS = 104; { Get Script Contents }
- AA_LASTERROR = 1001; { Get last error code }
- AA_LASTERRORMESSAGE = 1002; { Get/Set last error messsage }
-
-
- {
- The parameter type that can be used with aaSetParmIndirect
- }
-
- AA_SETMODE = $01; { Get/Set Animation Flags }
- AA_SETWINDOW = $02; { Set/Get animation window }
- AA_SETSPEED = $04; { Set/Get current speed }
- AA_SETPOSITION = $08; { Set/Get current frame position }
- AA_SETLOOPS = $10; { Set/Get number of loops }
- AA_SETX = $20; { Set/Get left of display window }
- AA_SETY = $40; { Set/Get left of display window }
- AA_SETCX = $80; { Set/Get top of display window }
- AA_SETCY = $100; { Set/Get top of display window }
- AA_SETORGX = $200; { Set/Get width of display window }
- AA_SETORGY = $400; { Set/Get width of display window }
- AA_SETRPTSOUND = $800; { Set/Get sound repeats }
- AA_SETPAUSE = $1000; { Set/Get pause time }
- AA_SETDELAYSND = $2000; { Set/Get sound delay time }
- AA_SETTRANSIN = $4000; { Set/Get Transition In type }
- AA_SETTRANSOUT = $8000; { Set/Get Transition Out type }
- AA_SETTIMEIN = $10000; { Set/Get Transition In time }
- AA_SETTIMEOUT = $20000; { Set/Get Transition Out Time }
- AA_SETCALLBACK = $40000; { Set/Get Callback window }
- AA_ALL = $FFFFFFFF; { Get/Set all parameters }
-
-
- {
-
- Status values for an animation
- }
-
- AA_STOPPED = 1; { Loaded but not playing }
- AA_QUEUED = 2; { Animation is waiting to play }
- AA_PLAYING = 3; { Animation is playing }
- AA_PAUSED = 4; { Animation is paused }
- AA_DONE = 5; { Animation has ended playing, }
- { and is awaiting an aaStop call }
-
-
- {
-
- File type definitions
- }
-
- AA_FLI = $01; { Autodesk Animator Fli format }
- AA_DIB = $02; { Windows DIB format }
- AA_NUMTYPES = $02; { Number of types }
- AA_SCRIPT = $03; { Script without an animation }
-
-
- {
- Transition types
- }
-
- AA_CUT = $00; { Just stop one and start another }
- AA_FADEBLACK = $01; { Fade In/Out from to black }
- AA_FADEWHITE = $02; { Fade In/Out from to white }
-
-
- {
- Error codes returned by aaGetParm(xxx, AA_LASTERROR)
- }
-
- AA_ERR_NOERROR = $00; { Unknown error }
- AA_ERR_NOMEMORY = $100; { Out of memory error }
-
- AA_ERR_BADHANDLE = $101; { Bad handle }
- AA_ERR_NOTIMERS = $102; { Cannot start timer }
- AA_ERR_BADSOUND = $103; { Bad sound spec }
- AA_ERR_NOSCRIPT = $104; { Requires a script }
- AA_ERR_WRITEERR = $105; { Write error for script }
- AA_ERR_BADANIMATION = $106; { Can not opem animation }
- AA_ERR_BADWINDOWHANDLE = $200; { Bad Window Handle }
-
- AA_ERR_WINDOWCREATE = $201; { Cannot create window }
- AA_ERR_DLGERROR = $202; { Dialog error }
- AA_ERR_INVALIDSTATUS = $300; { Invalid status }
-
- AA_ERR_BADDIBFORMAT = $301; { Bad dib file }
- AA_ERR_BADFLIFORMAT = $302; { Bad fli file }
- AA_ERR_UNRECOGNIZEDFORMAT = $303; { Unrecognized format }
- AA_ERR_NOSOUND = $304; { Sound not supported }
- AA_ERR_NOTVALIDFORSCRIPTS = $305; { Not valid for scripts }
- AA_ERR_INVALIDFILE = $306; { Bad file handle }
- AA_ERR_NOSCRIPTS = $307; { No Script files }
- AA_ERR_SPEED = $400; { Invalid speed }
-
- AA_ERR_LOOPS = $401; { invalid loops }
- AA_ERR_RPTSOUND = $402; { invalid repeat sound }
- AA_ERR_PAUSE = $403; { invalid pause }
- AA_ERR_TRANSIN = $404; { invalid transition }
- AA_ERR_TIMEIN = $405; { invalid transition }
- AA_ERR_TRANSOUT = $406; { invalid transition time }
- AA_ERR_TIMEOUT = $407; { invalid transition time }
- AA_ERR_DELAYSND = $408; { invalid sound delay }
- AA_ERR_INVALIDTYPE = $409; { invalid parameter type }
- AA_ERR_DUPLICATENOTIFY = $500; { duplicate notify }
-
- AA_ERR_NOSWITCH = $600; { no switch in script }
-
- AA_ERR_PARSELOOPS = $601; { Bad loops in script }
- AA_ERR_PARSESPEED = $602; { Bad speed in script }
- AA_ERR_BADRPTSOUND = $603; { Bad repeat sound in script }
- AA_ERR_PARSEPAUSE = $604; { Bad pause in script }
- AA_ERR_PARSETRANS = $605; { Bad tranisition in script }
- AA_ERR_PARSEDELAYSND = $606; { Bad delay sound in script }
- AA_ERR_TOOMANYLINKS = $607; { Too many links }
-
-
- {
- aaShow will show a single frame of an animation in a window.
- The mode determines how the animation is drawn. The window used
- is set using either aaSetParm or aaSetParmIndirect. aaShow returns
- TRUE if the animation was successfully drawn.
- }
-
- function aaShow(HAnim: HWnd; Show: WordBool): LongBool;
-
-
- {
-
- result =aaGetFile(wFlags, lpszPath, wBufLen, lpszDriver, wDrvLen)
-
- Opens a dialog box querying the user for a file in the standard windows
- file open box style. <dwFlags> determines how the dialog box will appear.
- It may be the following:
-
- AA_GETFILE_MUSTEXIST Selected file must satisfy conditions of
- OpenFile() flags, else dialog beeps.
- AA_GETFILE_NOSHOWSPEC DO NOT show the search spec in the edit box.
- Default IS to show the spec.
- AA_GETFILE_SAVE Ok button will show "Save".
- AA_GETFILE_OPEN Ok button will show "Open".
- AA_GETFILE_USEFILE Set the filename to the file in lpszPath
- AA_GETFILE_UDEDIR Change to the directory in lpszPath
- AA_GETFILE_SOUND Get sound file and driver
- AA_GETFILE_SCRIPT Get script file
- AA_GETFILE_ANIMATION Get Animation File (no scripts)
-
- <lpszPath> is a LPSTR to a string buffer into which the final fully
- qualified pathname will be written. <wBufLen> is the length of this
- buffer.
-
- <lpszDriver> is a LPSTR to a string buffer into which a sound device
- selection is placed. <wDrvLen> is the length of this buffer.
-
- Return value is: 0 = if cancel was hit
- -1 = if OpenFile() failed but AA_GETFILE_MUSTEXIST was not specified.
- .. = DOS file handle of selected file, otherwise. This handle is not
- open when aaOpenFile returns.
- }
-
- function aaGetFile(Flags: LongInt; Path: PChar; BufLen: Integer;
-
- Driver: PChar; DrvLen: Integer): Integer;
-
-
- {
-
- flags:
- can be any of the following
- }
-
- const
- AA_GETFILE_MUSTEXIST = $01;
- AA_GETFILE_NOSHOWSPEC = $02;
- AA_GETFILE_SAVE = $04;
- AA_GETFILE_OPEN = $08;
- AA_GETFILE_USEDIR = $10;
- AA_GETFILE_USEFILE = $20;
- AA_GETFILE_SOUND = $40;
- AA_GETFILE_SCRIPT = $80;
- AA_GETFILE_ANIMATION = $100;
-
-
- {
- Save a script
- }
-
- function aaSave(HAnim: HWnd; Mode: Word): Integer;
-
-
- {
- wMode Values
- }
-
- const
- AA_SAVE_IFMODIFIED = 1;
- AA_SAVE_AS = 2;
- AA_SAVE_CANCEL = 4;
-
-
- {
- Get Capabitities
- }
-
- function aaGetCaps(ParmType: Word): Integer;
-
-
- {
- Capabitlities
- }
-
- const
- AA_CAP_TIMER = 1;
- AA_CAP_SOUND = 2;
- AA_CAP_SCRIPT = 3;
-
-
- {
- Animation status messages
- Use RegisterWindowMessage to get the real message
- numbers.
- }
-
- AA_NOTIFY = 'AAPLAY Notify'; { notification message }
- AA_STOP = 'AAPLAY Stop'; { stop message }
-
-
- {
- These are sent in the low word of lParam with the AA_ERROR
- message. They indicate the error that occured
- }
-
- AA_BADPLAY = 1; { Error attempting to play }
- AA_BADNOTIFY = 2; { Error attempting to notify }
- AA_BADSCRIPT = 3; { Error attempting to animation in script }
-
- implementation
-
- function aaOpen: Integer; external 'AAPlay.DLL' index 7;
- procedure aaClose; external 'AAPlay.DLL' index 8;
-
- function aaLoad(FileName: PChar; WinHandle: HWnd; Mode: Word;
- X, Y, Width, Height, OrgX, OrgY: Integer): Integer; external 'AAPlay.DLL' index 9;
- function aaReLoad(HAnim: HWnd; FileName: PChar; Mode, Mask: Word): Integer; external 'AAPlay.DLL' index 23;
- function aaUnload(HAnim: HWnd): LongBool; external 'AAPlay.DLL' index 10;
-
- function aaSound(HAnim: HWnd; Device, FileName: PChar; Mode: Word): Integer; external 'AAPlay.DLL' index 22;
- function aaPlay(HAnim: HWnd): LongBool; external 'AAPlay.DLL' index 12;
- function aaNotify(HAnim: HWnd; Position: LongInt; lParam: LongInt): LongBool; external 'AAPlay.DLL' index 20;
-
- function aaCancel(HAnim: HWnd; LoPos, HiPos: LongInt): Integer; external 'AAPlay.DLL' index 21;
- function aaStop(HAnim: HWnd): LongBool; external 'AAPlay.DLL' index 13;
- function aaPause(HAnim: HWnd): LongBool; external 'AAPlay.DLL' index 18;
- function aaPrompt(HAnim: HWnd; Name: PChar): HWnd; external 'AAPlay.DLL' index 11;
-
- function aaGetParm(HAnim: HWnd; ParmType: Word): LongInt; external 'AAPlay.DLL' index 14;
- function aaGetParmIndirect(HAnim: HWnd; var AParams: TAAParms; Size: Integer): LongInt; external 'AAPlay.DLL' index 15;
- function aaSetParm(HAnim: HWnd; ParmType: Word; HValue: Integer; LValue: LongInt): LongInt; external 'AAPlay.DLL' index 16;
- function aaSetParmIndirect(HAnim: HWnd; ParmType: LongInt; AParams: TAAParms; Mask: Word): LongInt;
- external 'AAPlay.DLL' index 17;
-
- function aaShow(HAnim: HWnd; Show: WordBool): LongBool; external 'AAPlay.DLL' index 19;
- function aaGetFile(Flags: LongInt; Path: PChar; BufLen: Integer;
- Driver: PChar; DrvLen: Integer): Integer; external 'AAPlay.DLL' index 24;
-
- function aaSave(HAnim: HWnd; Mode: Word): Integer; external 'AAPlay.DLL' index 25;
- function aaGetCaps(ParmType: Word): Integer; external 'AAPlay.DLL' index 26;
-
- procedure AAExitProc; far;
- begin
- aaClose;
- end;
-
- begin
- AddExitProc(AAExitProc);
- end.
-